import React from 'react'
import PropTypes from 'prop-types'
export default function Nav({ children }) {
  let items = React.Children.toArray(children)
  for (let i = items.length - 1; i >= 1; i--){
    items.splice(
      i,0,(<span key={i}> - </span>)
    )
  }
  return <div>{items}</div>
}
Nav.propTypes = {
  children:PropTypes.arrayOf(PropTypes.element)
}
/*
x = 0
this.setState({x:1})
this.setState({x:this.state.x+1})
*/